//
//  OpenGLExampleAppDelegate.m
//  OpenGLExample
//
//  Copyright Google Inc 2010. All rights reserved.
//

#import "OpenGLExampleAppDelegate.h"
#import "EAGLView.h"

@implementation OpenGLExampleAppDelegate

@synthesize window;
@synthesize glView;

static GADAdViewController *adViewController = nil;

- (GADAdViewController *)getAdViewController {
  if (adViewController == nil) {
    adViewController = [[GADAdViewController alloc] initWithDelegate:nil];
  }
  return adViewController;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [glView startAnimation];
  return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
  [glView stopAnimation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
  [glView startAnimation];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
  [glView stopAnimation];
}

- (void)dealloc
{
  [adViewController release];
  [window release];
  [glView release];

  [super dealloc];
}

@end
